package com.xaicode.locker.JavaSJMS.three.BehaviorMode.Mediator;

/**
 * 实现Mediator，持有业务对象
 * @author Locker <br>
 *         2017年5月6日 上午10:02:40
 * @version v1.0
 */
public class MyMediator implements Mediator {

	// 业务对象
	private User1 user1;
	private User2 user2;

	public User getUser1() {
		return user1;
	}

	public User getUser2() {
		return user2;
	}

	@Override
	public void createMediator() {
		user1 = new User1(this);  
        user2 = new User2(this);
	}

	@Override
	public void workAll() {
		user1.work();  
        user2.work(); 
	}

}
